home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Run Magazine ReRun 1985 Summer
/
rerun-1985-summer-side-a.d64
/
bargain hunter
(
.txt
)
next >
Wrap
Commodore BASIC
|
2022-09-20
|
4KB
|
127 lines
1 rem 64 version/wallace
100 print"[147]":goto230
105 poke198,0:print"[145]";j$;" not on file":gosub130:return
110 ife$="none"thenreturn
115 e$=right$(e$,5)+" "+left$(e$,2)+" ":return
120 print"searching[146]":return
125 print"press c to continue"
130 print"press m for menu"
135 getf$:iff$=""then135
140 return
145 print"[147]enter month expires (2 digits)":forl=1to6:e$(l)="":next
150 ifz1=0thenprint"enter n if no expiration"
155 forl=1to6
160 gete$(l):ife$(l)=""ore$(l)<"0"ore$(l)>"9"ande$(l)<>"n"then160
165 ifz1=1ande$(l)="n"then160
170 ife$(l)="n"andz1=0then205
175 print""e$(l)"[145]"
180 ifl=2thenprint""e$(1);e$(2):print"enter day (2 digits)
185 [139]l[178]4[167][153]""e$(3);e$(4):[153]"enter year (2 digits)
190 next:print""e$(5);e$(6)
195 e$=e$(5)+e$(6)+" "+e$(1)+e$(2)+" "+e$(3)+e$(4)
200 e1$=e$(1)+e$(2)+" "+e$(3)+e$(4)+" "+e$(5)+e$(6):goto210
205 e$="none":e1$=e$
210 print""e1$:print"ok (y/n)"
215 gosub135:iff$="n"then145
220 iff$="y"thenreturn
225 goto215
230 bc=53280:sc=53281:pokebc,6:pokesc,1:b%=0:c%=0:d1$=" cents "
235 print"[147][151]coupon organizer[146]":print"1[146] review entire file"
240 print" 2[146] search by brand name":print" 3[146] search by product"
245 print" 4[146] compute total value":print" 5[146] dump to printer"
250 print" 6[146] update coupon file":print" 7[146] save updated file"
255 print" 8[146] quit":print"select function[146]"
260 gosub135:restore:iff$<"1"orf$>"8"then260
265 a=val(f$):onagoto275,290,295,555,335,610,590,270:goto265
270 sc=53281:pokesc,6:pokebc,14:print"[147][154]":clr:end
275 pokebc,7:gosub540:ifa$="end"then230
280 print"[147]":gosub445:iff$="m"then230
285 goto275
290 pokebc,8:input"[147] enter brand";j$:gosub120:b%=1:goto300
295 pokebc,9:input"[147] enter product";j$:gosub120:c%=1
300 gosub540:ifa$="end"then325
305 ifb%thenifb$<>j$then300
310 ifc%thenifc$<>j$then300
315 gosub445:gosub120:z=1:iff$="m"then230
320 goto300
325 ifzthen230
330 gosub105:goto230
335 pokebc,15:print"[147]printer ready? (y/n)"
340 gosub135:iff$<>"y"andf$<>"n"then340
345 iff$="n"then230
350 open1,4,1
355 reada$:ifa$="end"thenclose1:goto230
360 ifa$="#"thenreada:goto355
365 readb$,c$,d$,e$:gosub110
370 print#1,a$" "c$" "b$" "d$d1$" "e$:ifpthenclose1:goto425
375 goto355
380 z=0:restore:z1=1:gosub145:z1=0:j$=e$
385 print"[147]":gosub120:d1$=" cents "
390 gosub540:ifa$="end"then430
395 ifval(e$)>val(j$)orval(e$)<1then390
400 p=1:gosub445:gosub120:z=1:iff$="m"then230
405 iff$="p"thenr$=a$:print"[145]hard copy? (y/n)":goto415
410 goto390
415 gosub135:iff$="y"thenopen1,4,1:goto370
420 iff$<>"n"then415
425 goto690
430 ifzthen440
435 e$=j$:gosub115:print"[145] none expired as of ";e$;"":gosub130
440 p=0:goto230
445 forl=1to3:d(l)=int(rnd(0)*14)+2:next:b=32:e=646
450 h$=" [146]":print"[147] file number:";a$
455 pokee,d(1):print"";h$:print;h$:print;h$
460 forl=1to7:print" ":pokee,d(2):print,"[145][157] "
465 pokee,d(1):print,,,"[145] ":next:print;h$:print;h$
470 print" [175] [175] [175] [175][160][175] [175] [175] [175] [175][160][175] [175][160][175] [175][160][175] [175] [175] [146]"
475 forl=1to5:print"[170]"spc(31)"[180]":print:next
480 print" [183] [183] [183] [183] [183] [183] [183] [183] [183] [183] [183] [183] [183] [183] [183] [183] [146]":gosub110
485 ifval(d$)>99thenb=29:ifval(d$)>999thenb=28
490 ifval(d$)>99thend$="$"+left$(d$,len(d$)-2)+"."+right$(d$,2)
495 ifd$="free"thenb=30
500 pokee,d(3):print""tab(5)d$tab(b)d$:pokee,d(2):print,""b$
505 print,""c$:print,"exp. date: "e$:pokee,d(3):print""tab(5)d$tab(b)d$
510 print"[146][151]":poke198,0
515 ifpthenprint"press p to purge coupon[146]"
520 gosub125:iff$<>"m"andf$<>"c"andf$<>"p"thenprint"[145][145][145][145][145]":goto530
525 return
530 ifpthenprint"[145]"
535 goto520
540 reada$:ifa$="end"thenreturn
545 ifa$="#"thenreada:goto540
550 readb$,c$,d$,e$:return
555 d$="":t=0
560 pokebc,5:gosub540:ifa$="end"then570
565 t=t+val(d$):print"[147]";t:pokebc,13:goto560
570 t$=str$(t):z$=right$(t$,2):x$=left$(t$,len(t$)-2):t$=x$+"."+z$
575 print"[147]total value: $";t$;""
580 gosub130:iff$<>"m"thenprint"[145][145][145]":goto580
585 goto230
590 pokebc,4:print"[147]t[146]ape or d[146]isk?[145]":gosub135:iff$<>"t"andf$<>"d"then590
595 iff$="t"thensave"coupon organizer":goto230
600 print"saving update[146]":open15,8,15:print#15,"s0:coupon organizer"
605 close15:save"coupon organizer",8:goto230
610 bc=53280:pokebc,2:print"[147] 1[146] add new coupons"
615 print" 2[146] purge redeemed coupons"
620 print" 3[146] purge expired coupons":print" 4[146] return to menu"
625 p$(1)="brand name":p$(2)="product":p$(3)="coupon value (in cents)"
630 d1$=" cents "
635 gosub135:a=val(f$):onagoto645,685,380,230:goto610
640 poke198,2:poke631,13:poke632,13:end
645 print" standby[146]"
650 a=val(a$)+1:reada$:ifa$="#"thenreada:goto660
655 ifa$<>"end"thenreadb$,c$,d$,e$:goto650
660 print"[147]item : "a"":fori=1to3:print""p$(i):input"";w$(i)
665 ifw$(1)=""then610
670 next:gosub145:w$(0)=str$(a):m=a*5+1000:print"[147]"
675 printm;"data"a","w$(1)","w$(2)","w$(3)","e$
680 print"goto610":goto640
685 print"[147]remove file number":input" ";r$:ifval(r$)=0then685
690 print"[147]":m=val(r$)*5+1000:printm"data"chr$(34)"#"chr$(34)","val(r$)
695 ifpthenp=0:goto705
700 print"j$="chr$(34)j$chr$(34)":z=1:goto610":goto640
705 print"j$="chr$(34)j$chr$(34)":z=1:goto385":goto640
1000 rem files
1005 data 1 ,sample coupon,example only,none,none
50000 dataend